/**
 * Created by liuzeduo on 2017/8/6.
 */
$(document).ready(function(){

    var $inventory=$('#shoes tbody');
    var quantity=$inventory.find('td:nth-child(2)')
        .map(function(index,qty){
            return $(qty).text();
        }).get();
    var sum= $.sum(quantity);
    var average= $.average(quantity);
    $('#sum').find('td:nth-child(2)').text(sum);
    $('#average').find('td:nth-child(2)').text(average);
});
